home *** CD-ROM | disk | FTP | other *** search
/ Rat Attack (UK) (Digital Press Kit - Summer '99) / Rat Attack (UK) (Digital Press Kit - Summer '99).bin / RAT01.DIR / 00148_Script_Random Sound < prev    next >
Text File  |  1999-04-26  |  2KB  |  74 lines

  1. --  Random Sound mouseOver
  2.  
  3. -- also functions through lingo by handling message 'initPlayMember', 
  4. -- for example if this behavior was assigned to sprite 5, use
  5. -- sendsprite 5, #initPlayMember
  6.  
  7. -- Media
  8. property WhichEvent, WhichSound, WhichChannel, StartImmediately
  9. property tester
  10.  
  11. on initPlayMember me
  12.   init me
  13. end
  14.  
  15.  
  16. on mouseUp me
  17.   if whichEvent = #mouseup    then init me
  18. end
  19.  
  20. on mouseDown me
  21.   if whichEvent = #mousedown  then init me
  22. end
  23.  
  24. on mouseEnter me
  25.   if whichEvent = #mouseenter then init me
  26. end
  27.  
  28. on enterFrame me
  29.   if whichEvent = #enterframe then init me
  30. end
  31.  
  32. on exitFrame me
  33.   if whichEvent = #exitframe  then init me
  34. end
  35.  
  36. on init me 
  37.   doSound
  38.   global mySound
  39.   puppetSound the WhichChannel of me, mySound -- the whichSound of me
  40.   if the StartImmediately of me then updatestage
  41. end
  42.  
  43. ---
  44.  
  45. on getPropertyDescriptionList
  46.   
  47.   set p_list = [ ¼
  48.           #WhichSound: [ #comment:   "Sound:", ¼
  49.                           #format:   #sound, ¼
  50.                          #default:   "clik" ], ¼
  51.         #WhichChannel: [ #comment:   "Channel:", ¼
  52.                           #format:   #integer, ¼
  53.                          #default:    1 ], ¼
  54.           #WhichEvent: [ #comment:   "Initializing Event:", ¼
  55.                           #format:   #symbol, ¼
  56.                            #range: [ #MouseUp, #MouseDown, #MouseEnter, #EnterFrame, #ExitFrame, #InitPlayMember ], ¼
  57.                          #default:   #MouseEnter ]¼
  58.                  ]
  59.   return p_list
  60.   
  61. end
  62.  
  63. on getBehaviorDescription
  64.   return ¼
  65. "Plays a random sound calling doSound in Movie Script when the specified event occurs, or when the message ." & RETURN & ¼
  66. "PARAMETERS:" & RETURN & ¼
  67. "ò Sound - Choose the sound cast member to be played."  & RETURN & ¼
  68. "ò Channel - Enter the sound channel number to be used for playback."  & RETURN & ¼
  69. "ò Initializing Event - Specify the event that triggers the behavior."
  70.   
  71. end
  72.  
  73.  
  74.